
// 功能 ：定义一个操作数据库的类，支持Mysql Mssql MongDb
// 要求 功能一样，都有add update detele get方法

interface IDB<T> {
    add(info: T): T[]
    update(info: T, id: number): boolean
    detele(id: number): boolean
    get(id: string): any[]
}

// 操作mysql的类
class Mysql<T> implements IDB<T>{
    add(info: T): T[] {
        console.log(info);
        return [info]
    }
    update(info: T, id: number): boolean {
        throw new Error("Method not implemented.");
    }
    detele(id: number): boolean {
        throw new Error("Method not implemented.");
    }
    get(id: string): any[] {
        return ['获取到了用户数据']
    }
}
// 操作mssql的类
class Mssql<T> implements IDB<T>{
    add(info: T): T[] {
        console.log(info);
        return [info]
    }
    update(info: T, id: number): boolean {
        throw new Error("Method not implemented.");
    }
    detele(id: number): boolean {
        throw new Error("Method not implemented.");
    }
    get(id: string): any[] {
        return ['获取到了文章数据']
    }
}
export { Mysql, Mssql }